<?php namespace App\Models;

use Watson\Validating\ValidatingTrait;
use Illuminate\Database\Eloquent\Model;

/**
 * 公告
 * Class Announcement
 *
 * @package App\Models
 * @property int $id
 * @property string $title 标题
 * @property string $content 内容
 * @property string $created_at
 * @property string $updated_at
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Announcement whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Announcement whereTitle($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Announcement whereContent($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Announcement whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Announcement whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Announcement extends Model
{
    use ValidatingTrait;

    protected $fillable = ['title', 'content'];

    protected $rules = [
        'title'   => 'required',
        'content' => 'required',
    ];

    protected $validationMessages = [
        'title.required'   => '标题必填',
        'content.required' => '内容必填',
    ];
}